/*
 * SAMainContainer.h
 *
 *  Created on: 2010-06-04
 *      Author: NONO
 */

#ifndef __SAMAINCONTAINER_H__
#define __SAMAINCONTAINER_H__

// INCLUDES
#include <aknlists.h>                   // CAknColumnListBox
#include "SABaseContainer.h"
   
// FORWARD DECLARATIONS
class CSAAppUi;

/**
*  CSAMainContainer  container control class.
*  
*/
class CSAMainContainer : public CSABaseContainer, 
                         public MCoeControlObserver
{
    public: // Constructors and destructor
        
        /**
        * EPOC default constructor.
        * @param aRect Frame rectangle for container.
        */
        void ConstructL(const TRect& aRect);
        
        CSAMainContainer(CSAAppUi& aAppUi);

        /**
        * Destructor.
        */
        ~CSAMainContainer();

    protected: // Functions from base classes
        
        virtual void ChangeViewMenuL(TInt aResourceId);

    protected: // Functions from base classes

       /**
        * From CoeControl,SizeChanged.
        */
        virtual void SizeChanged();

       /**
        * From CoeControl,CountComponentControls.
        */
        virtual TInt CountComponentControls() const;

       /**
        * From CCoeControl,ComponentControl.
        */
        virtual CCoeControl* ComponentControl(TInt aIndex) const;

       /**
        * From CCoeControl,Draw.
        */
        virtual void Draw(const TRect& aRect) const;

        
        virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
        
        /**
        * From MCoeControlObserver
        * Acts upon changes in the hosted control's state. 
        *
        * @param    aControl    The control changing its state
        * @param    aEventType  The type of control event 
        */
        virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
        
        /**
        * From CoeControl, HandleResourceChange.
        * Called by framework when the view layout is changed.
        */
        virtual void HandleResourceChange(TInt aType);
        
    private:
        void CreateMsgListL();
        void SetupMsgboxListItemsL();
        
        // should remove to COMMON UTILITY in the future
        void SetupListIconsL(CEikFormattedCellListBox& aListBox, TInt aIndex);
        void SetupEmptyListPromptL(CEikListBox& aListBox, const TInt aResourceId);

    private: //data
        
        CEikFormattedCellListBox*               iMsgboxListBox;
};

#endif /* __SAMAINCONTAINER_H__ */
